<?php 
class PaymentAction extends BaseAction {
	
	
	/**
	 *用于显示上架商品列表
	 */
	public function index() {
		
		$trade_no			= $_REQUEST['trade_no'];	//支付交易编码
		$item_id			= $_REQUEST['item_id'];		//对应支付数据项ID
		$bprice				= $_REQUEST['bprice'];		//价格上限
		$sprice				= $_REQUEST['sprice'];		//价格下限
		$pay_type			= $_REQUEST['pay_type'];	//支付类型：对应数据字典-付款类型
		$sub_pay_type			= $_REQUEST['sub_pay_type'];	//支付类型：对应数据字典-付款类型
		$pno				= $_REQUEST['pno'];			//页数
		$pay_service		= $_REQUEST['pay_service'];	//支付服务提供商	
		$enable				= $_REQUEST['enable'];		//是否可用（是否有效）
		$is_confirmed		= $_REQUEST['is_confirmed'];//是否已确认支付（支付是否与具体项绑定）
		$user_email			= $_REQUEST['user_email'];//是否已确认支付（支付是否与具体项绑定）
		if(!empty($user_email)){
			$res = M('User')->where("`email`='".$user_email."'")->find();
			if(!empty($res['id']))$uid = $res['id'];
		}
		if(!empty($sub_pay_type))$map['sub_pay_type']			= $sub_pay_type;
		if(!empty($trade_no))$map['trade_no']	= $trade_no;
		if(!empty($uid))$map['user_id']			= $uid;
		if(!empty($item_id))$map['item_id']		= $item_id;
		if(!empty($pay_type))$map['pay_type']	= $pay_type;
		if(!empty($pay_mode))$map['service']	= $pay_mode;
		if(!empty($bprice))$map['total_fee']	=array('LT',$bprice);
		if(!empty($sprice))$map['total_fee']	=array('GT',$sprice);
		if(in_array($enable,array('Y','N')))$map['enable']	= $enable;
		if($is_confirmed=='all'){
		}else {
			if($is_confirmed=='Y')$map['is_confirmed']	= 'Y';
			if($is_confirmed=='N')$map['is_confirmed']	= 'N';
		}
		$order='ctime desc';
		$datapage = model('Pay')->kPageQuery($map,$order,10);
		
		$this->assignRequestParams();
		$this->assign( 'datapage', $datapage );
		$this->display();

	}
	
	
	
}